<?
include_class('venues');
include_class('locations');
$so = $args['show'];
if (is_object($so) && !db::isError($so)) {
	$notes = $so->getNotes();
	$ID = $so->getID();
	$venue = $so->getVenueObject();
	if (db::isError($venue) || !is_object($venue)) {
		unset($venue);
	} else {
	
		$venueName = $venue->getName();
		$venueAddress1 = $venue->getAddress1();
		$venueAddress2 = $venue->getAddress2();
		$venueCity = $venue->getCity();
		$venueStateProvince = $venue->getStateProvince();
		$venuePostalCode = $venue->getPostalCode();
		$venueCountry = $venue->getCountry();
	}
	$name = USE_MOD_REWRITE ? '<a href="' . SITE_WEB_DIRECTORY . '/show/' . $ID . '">' . $so->getName() . '</a>' : '<a href="' . SITE_WEB_DIRECTORY . '/shows.php?id=' . $ID . '">' . $so->getName() . '</a>';
	$access = ($so->isAllAges()) ? "All Ages!" : "21 and Over";
	
	$uo = $so->getUserObject();
	$cost = $so->getCost();
	$date = $so->getDate("F d, Y");
	$time = $so->getTime("g:i A");

	
	if ($uo->isBandMember()) { 
		$bm = BandMember::getByUserID($uo->getID());
		if ($bm->isActive()) {
			if (USE_MOD_REWRITE) {
				$poster = '<a href="' . SITE_WEB_DIRECTORY . '/member/' . $ID . '/">Read More</a>';
			} else {
				$poster = '<a href="' . SITE_WEB_DIRECTORY . '/member.php?id=' . $bm->getID() . '">Read More</a>';
			}
		} else {
			$poster = $firstname;
		}
	} else {
		$poster = $firstname;
	}
	
	$moreLink = '';
	if (!$args['suppressLink']) {
		if (USE_MOD_REWRITE) {
			$moreLink = '<a href="' . SITE_WEB_DIRECTORY . '/show/' . $ID . '/">Read More</a>';
		} else {
			$moreLink = '<a href="' . SITE_WEB_DIRECTORY . '/shows.php?id=' . $ID . '">Read More</a>';
		}
	}
	$photoArea = $so->getPhotoAreaObject();
	if (!db::isError($photoArea)) {
		$numPhotos = $photoArea->getNumFiles();
		if ($numPhotos > 0) {
			$photos = new SectionTemplate;
			$photos->file = "gallery.php";
			$photos->args['area'] = &$photoArea;
			if (USE_MOD_REWRITE) {
				$photos->args['url'] = '/show/' . $so->getID() . '/';
			} else {
				$photos->args['url'] = '/shows.php?id=' . $so->getID();
			}
		}
	}
	
	$avArea = $so->getAVAreaObject();
	if (!db::isError($avArea)) {
		$numAudio = $avArea->getNumFiles();
		if ($numAudio > 0) {
			$av = new SectionTemplate;
			$av->file = "media_list.php";
			$av->args['area'] = &$avArea;
			if (USE_MOD_REWRITE) {
				$av->args['url'] = '/show/' . $so->getID() . '/';
			} else {
				$av->args['url'] = '/shows.php?id=' . $so->getID();
			}
		}
	}
}
?>